import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22652
 * Date: 2024-04-29
 * Time: 18:28
 */
public class demo_2 {
   public static int maxLength (int[] arr){
        Map<Integer,Integer> hashMap=new TreeMap<>();
        int i=0;
        for (int j : arr) {
            hashMap.put(j, 1);
        }
        return hashMap.keySet().toArray().length;
    }
    public static void main(String[] args) {
        int[] arr={2,2,3,4,3};
        System.out.println(maxLength(arr));
    }

}
